package com.lj.api.common;

import com.google.gson.Gson;

public class GsonUtil {
    private static Gson gson = null;

    static {
        gson = new Gson();
    }

    /*对象转json串*/
    public static String toJson(Object o) {
        return gson.toJson(o);
    }

    /*从json串封装对象*/
    public static <T> T fromJson(String s, Class<T> cls) {
        return gson.fromJson(s, cls);

    }


}
